package com.qd.core.close;

import com.qd.core.dblog.LogProcess;
import com.qd.pay.config.ProcessConfig;
import com.qd.system.service.msg.server.MsgProcess;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.stereotype.Component;

/**
 * @author sjk
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class DisposableBeanImpl implements DisposableBean {
    private final ProcessConfig processConfig;
    @Override
    public void destroy() {
        log.info("销毁：DisposableBeanImpl.destroy");
        MsgProcess.getInstance().shutdown();
        LogProcess.getInstance().shutdown();
        processConfig.destroy();
    }
}